<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" href="/adminlte/layui/css/layui.css" media="all"/>
    <style>
        .layui-form-label{
            width: 93px;
            font-family: 宋体;
        }
    </style>
</head>
<body >
<form class="layui-form" action="#" style="background-color: #FFFFFF">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
        <legend style="color: #0d6aad;font-family: 黑体">订单信息</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">产品名称</label>
            <div class="layui-input-inline">
                <select name="goodsName" lay-verify="required" lay-search="" >
                    <option value="" name="">请选择产品名称</option>
                    <option th:each="goodsNameP1:${goodsNameP}" th:value="${goodsNameP1.dataname}" th:text="${goodsNameP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">产品规格</label>
            <div class="layui-input-inline">
                <select name="specifications" lay-verify="required" lay-search="">
                    <option value="">请选择产品规格</option>
                    <option th:each="specificationsP1:${specificationsP}" th:value="${specificationsP1.dataname}" th:text="${specificationsP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">使用压力</label>
            <div class="layui-input-inline">
               <!-- <input type="text" name="pressure" lay-verify="" autocomplete="off" class="layui-input" placeholder="请输入">-->
                <select name="pressure"  lay-search="" lay-verify="required">
                    <option value="">请选择使用压力</option>
                    <option th:each="pressureP1:${pressureP}" th:value="${pressureP1.dataname}" th:text="${pressureP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">数量</label>
            <div class="layui-input-inline">
                <input type="text" name="nums" lay-verify="required|number" autocomplete="off" class="layui-input" placeholder="请输入数量">
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 3px;">
        <legend style="color: #0d6aad;font-family: 黑体">阀门信息</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">阀门厂商</label>
            <div class="layui-input-inline">
                <select name="valveSupplier"  lay-search="" lay-verify="required">
                    <option value="">请选择阀门厂商</option>
                    <option th:each="valveSupplierP1:${valveSupplierP}" th:value="${valveSupplierP1.dataname}" th:text="${valveSupplierP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">阀门名称</label>
            <div class="layui-input-inline">
                <select name="valveName"  lay-search="" lay-verify="required">
                    <option value="">请选择阀门名称</option>
                    <option th:each="valveNameP1:${valveNameP}" th:value="${valveNameP1.dataname}" th:text="${valveNameP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">规格型号</label>
            <div class="layui-input-inline">
                <select name="valveSpecifications"  lay-search="" lay-verify="required">
                    <option value="">请选择规格型号</option>
                    <option th:each="valveSpecificationsP1:${valveSpecificationsP}" th:value="${valveSpecificationsP1.dataname}" th:text="${valveSpecificationsP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">进气方向</label>
            <div class="layui-input-inline">
            <select name="intakeDirection" lay-search="">
                <option value="">请选择进气方向</option>
                <option value="左进气">左进气</option>
                <option value="右进气">右进气</option>
            </select>
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 3px;">
        <legend style="color: #0d6aad;font-family: 黑体">主板信息</legend>
    </fieldset>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">控制主板厂商</label>
            <div class="layui-input-inline">
                <select name="controlMainboardSupplier" lay-verify="required" lay-search="" lay-filter="controlMainboardSupplierS">
                    <option value="">请选择控制主板厂商</option>
                    <option th:each="controlMainboardSupplierP1:${controlMainboardSupplierP}" th:name="${controlMainboardSupplierP1.id}" th:value="${controlMainboardSupplierP1.dataname}" th:text="${controlMainboardSupplierP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">控制主板名称</label>
            <div class="layui-input-inline">
                <select id="controlMainboardNameId" name="controlMainboardName" lay-verify="required" lay-search="" lay-filter="controlMainboardNameS">
                    <option value="">请选择控制主板名称</option>
                   <!-- <option th:each="controlMainboardNameP1:${controlMainboardNameP}" th:value="${controlMainboardNameP1.dataname}" th:text="${controlMainboardNameP1.dataname}"></option>-->
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">型号规格</label>
            <div class="layui-input-inline">
                <select id="controlMainboardSpecificationsId" name="controlMainboardSpecifications" lay-verify="required" lay-filter="controlMainboardSpecificationsS">
                    <option value="">请选择型号规格</option>
                    <!--<option th:each="controlMainboardSpecificationsP1:${controlMainboardSpecificationsP}" th:value="${controlMainboardSpecificationsP1.dataname}" th:text="${controlMainboardSpecificationsP1.dataname}"></option>-->
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">程序版本</label>
            <div class="layui-input-inline">
               <!-- <input type="text" name="version" lay-verify="" placeholder="" autocomplete="off" class="layui-input" placeholder="请输入程序版本">-->
                <select id="versionId" name="version" lay-verify="" lay-search="">
                    <option value="">请选择程序版本</option>
                    <!--<option th:each="versionP1:${versionP}" th:value="${versionP1.dataname}" th:text="${versionP1.dataname}"></option>-->
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">通信主板厂商</label>
            <div class="layui-input-inline">
                <select name="telMainBoardSupplier" lay-verify="" lay-search="">
                    <option value="">请选择通信主板厂商</option>
                    <option th:each="telMainBoardSupplierP1:${telMainBoardSupplierP}" th:value="${telMainBoardSupplierP1.dataname}" th:text="${telMainBoardSupplierP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">通信主板名称</label>
            <div class="layui-input-inline">
                <select name="telMainBoardName" lay-verify="" lay-search="">
                    <option value="">请选择通信主板名称</option>
                    <option th:each="telMainBoardNameP1:${telMainBoardNameP}" th:value="${telMainBoardNameP1.dataname}" th:text="${telMainBoardNameP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">型号规格</label>
            <div class="layui-input-inline">
                <select name="telMainBoardSpecifications" lay-verify="" lay-search="">
                    <option value="">请选择型号规格</option>
                    <option th:each="telMainBoardSpecificationsP1:${telMainBoardSpecificationsP}" th:value="${telMainBoardSpecificationsP1.dataname}" th:text="${telMainBoardSpecificationsP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">通信方式</label>
            <div class="layui-input-inline">
                <select name="telType" lay-verify="" lay-search="">
                    <option value="">请选择通信方式</option>
                    <option value="无">无</option>
                    <option value="LORA">LORA</option>
                    <option value="FSK">FSK</option>
                    <option value="GPRS">GPRS</option>
                    <option value="移动NB-IOT(直连)">移动NB-IOT(直连)</option>
                    <option value="移动NB-IOT(平台)">移动NB-IOT(平台)</option>
                    <option value="电信NB-IOT(平台)">电信NB-IOT(平台)</option>
                    <option value="联通NB-IOT(平台)">联通NB-IOT(平台)</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">485主板厂商</label>
            <div class="layui-input-inline">
                <select name="fourSupplier" lay-verify="" lay-search="">
                    <option value="">请选择485主板厂商</option>
                    <option th:each="fourSupplierP1:${fourSupplierP}" th:value="${fourSupplierP1.dataname}" th:text="${fourSupplierP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">485主板名称</label>
            <div class="layui-input-inline">
                <select name="fourMainBoardName" lay-verify="" lay-search="">
                    <option value="">请选择485主板名称</option>
                    <option th:each="fourMainBoardNameP1:${fourMainBoardNameP}" th:value="${fourMainBoardNameP1.dataname}" th:text="${fourMainBoardNameP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">型号规格</label>
            <div class="layui-input-inline">
                <select name="fourSpecifications" lay-verify="" lay-search="">
                    <option value="">请选择型号规格</option>
                    <option th:each="fourSpecificationsP1:${fourSpecificationsP}" th:value="${fourSpecificationsP1.dataname}" th:text="${fourSpecificationsP1.dataname}"></option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">通信协议</label>
            <div class="layui-input-inline">
              <!--  <input type="text" name="telProtocol" lay-verify="" placeholder="" autocomplete="off" class="layui-input">-->
                <select name="telProtocol" lay-verify="" lay-search="">
                    <option value="">请选择通信协议</option>
                    <option th:each="telProtocolp:${telProtocol}" th:value="${telProtocolp.flowmeterFac}" th:text="${telProtocolp.flowmeterFac}"></option>
                </select>
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 3px;">
        <legend style="color: #0d6aad;font-family: 黑体">功能参数</legend>
    </fieldset>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">计费方式</label>
            <div class="layui-input-inline">
                <select name="charMethod" lay-verify="required" lay-search="">
                    <option value="">请选择计费方式</option>
                    <option value="金额" selected>金额</option>
                    <option value="气量">气量</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">信号来源</label>
            <div class="layui-input-inline">
                <select name="signalSource" lay-verify="required" lay-search="">
                    <option value="">请选择信号来源</option>
                    <option value="干簧管取样">干簧管取样</option>
                    <option value="流量计信号(低有效)">流量计信号(低有效)</option>
                    <option value="流量计信号(高有效)">流量计信号(高有效)</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">脉冲当量</label>
            <div class="layui-input-inline">
                <select name="pulseEquivalent" lay-verify="required" lay-search="" lay-filter="test">
                    <option value="">请选择脉冲当量</option>
                    <option value="0.01m³/脉冲">0.01m³/脉冲</option>
                    <option value="0.1m³/脉冲">0.1m³/脉冲</option>
                    <option value="1m³/脉冲">1m³/脉冲</option>
                    <option value="10m³/脉冲">10m³/脉冲</option>
                    <option value="100m³/脉冲">100m³/脉冲</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">报警方数</label>
            <div class="layui-input-inline">
                <input type="text" name="alarmSquare" lay-verify="required|number" placeholder="请输入报警方数(m³)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">预留气量</label>
            <div class="layui-input-inline">
                <input type="text" name="reservedAir" lay-verify="required|number" placeholder="请输入预留气量(m³)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">开阀时间</label>
            <div class="layui-input-inline">
                <input type="text" name="valveOpenTime" lay-verify="required|number" placeholder="请输入开阀时间(s)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">关阀时间</label>
            <div class="layui-input-inline">
                <input type="text" name="valveCloseTime" lay-verify="required|number" placeholder="请输入关阀时间(s)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">充值上限</label>
            <div class="layui-input-inline">
                <input type="text" name="upperLimitOfRecharge" lay-verify="required|number" placeholder="请输入充值上限(m³)" value="0" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">透支气量</label>
            <div class="layui-input-inline">
                <input type="text" name="overdrawAir" lay-verify="required|number" placeholder="请输入透支气量(m³)" value="0" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">窃气检测</label>
            <div class="layui-input-inline">
                <select name="gasCheck" lay-verify="required" lay-search="">
                    <option value="">请选择窃气检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用" selected>未启用</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">断线检测</label>
            <div class="layui-input-inline">
                <select name="disconnectionCheck" lay-verify="required" lay-search="">
                    <option value="">请选择断线检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用" selected>未启用</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">低压检测</label>
            <div class="layui-input-inline">
             <!--   <input type="text" name="lowPressureCheck" lay-verify="" placeholder="" autocomplete="off" class="layui-input">-->
                <select name="lowPressureCheck" lay-verify="required" lay-search="">
                    <option value="">请选择低压检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用" selected>未启用</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
         <!--   <label class="layui-form-label">过流检测</label>
            <div class="layui-input-inline">
                <select name="overcurrentCheck" lay-verify="required" lay-search="">
                    <option value="">请选择过流检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用">未启用</option>
                </select>
            </div>-->
            <label class="layui-form-label">过流时间</label>
            <div class="layui-input-inline">
                <input type="text" name="overcurrentCheck" lay-verify="required|number" placeholder="请输入过流时间(秒)" autocomplete="off" class="layui-input" value="0">
            </div>
        </div>
        <div class="layui-inline">
           <!-- <label class="layui-form-label">微漏检测</label>
            <div class="layui-input-inline">
                <select name="microleakageCheck" lay-verify="required" lay-search="">
                    <option value="">请选择微漏检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用">未启用</option>
                </select>
            </div>-->
            <label class="layui-form-label">微漏时间</label>
            <div class="layui-input-inline">
                <input type="text" name="microleakageCheck" lay-verify="required|number" placeholder="请输入微漏时间(分)" autocomplete="off" class="layui-input" value="0">
            </div>
        </div>
        <div class="layui-inline">
           <!-- <label class="layui-form-label">失联检测</label>
            <div class="layui-input-inline">
                <select name="noContactCheck" lay-verify="required" lay-search="">
                    <option value="">请选择失联检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用">未启用</option>
                </select>
            </div>-->
            <label class="layui-form-label">失联天数</label>
            <div class="layui-input-inline">
                <input type="text" name="noContactCheck" lay-verify="required|number" placeholder="请输入失联天数(天)" autocomplete="off" class="layui-input" value="0">
            </div>
        </div>
        <div class="layui-inline">
           <!-- <label class="layui-form-label">停用检测</label>
            <div class="layui-input-inline">
                &lt;!&ndash;<input type="text" name="stopUseCheck" lay-verify="" placeholder="" autocomplete="off" class="layui-input">&ndash;&gt;
                <select name="stopUseCheck" lay-verify="required" lay-search="">
                    <option value="">请选择停用检测</option>
                    <option value="启用">启用</option>
                    <option value="未启用">未启用</option>
                </select>
            </div>-->
            <label class="layui-form-label">停用天数</label>
            <div class="layui-input-inline">
                <input type="text" name="stopUseCheck" lay-verify="required|number" placeholder="请输入停用天数(天)" autocomplete="off" class="layui-input" value="0">
            </div>
        </div>
    </div>
    <div class="layui-form-item" style="margin-top: -14px">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input style="width: 1050px;" type="text" name="remarks" lay-verify="title" autocomplete="off" placeholder="请输入备注" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center;">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo">立即提交</button>
           <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
        </div>
    </div>
</form>
<script src="/adminlte/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/adminlte/layui/jquery-3.2.1.min.js"></script>
<script>
  /*  $(
        function () {
            loadSelect1();
            specifications1();pressure();valveName1();valveSpecifications1();controlMainboardName1();controlMainboardSpecifications1();
            telMainBoardName1();telMainBoardSpecifications1();fourMainBoardName1();fourSpecifications1();Vavlesupp();controlSupp();
            telMainSupp();fourSupp();versionNow();
        }
    )*/
    layui.use('form', function() {
        var form = layui.form;
        form.on('select(test)', function(data){
            /*console.log(data);*/
            var valveSupplier = $("[name='valveSupplier']").val();
            var valveName = $("[name='valveName']").val();
            var valveSpecifications = $("[name='valveSpecifications']").val();
            var ConfPulse = $("[name='pulseEquivalent']").val();
            console.log(valveSupplier+"*"+valveName+"*"+valveSpecifications+"*"+ConfPulse+"*")
            if (valveSupplier!=""&&valveName!=""&&valveSpecifications!=""&&ConfPulse!="") {
                $.ajax({
                    //几个参数需要注意一下
                    type: "POST",//方法类型
                    dataType: "json",//预期服务器返回的数据类型
                    url: "/assist/queryAssist" ,//url
                    data:{valveSupplier:valveSupplier,valveName:valveName,valveSpecifications:valveSpecifications,ConfPulse:ConfPulse},
                    success: function (result) {
                        if (result.success>0) {
                            $("[name='alarmSquare']").val(result.alarmVol);
                            $("[name='reservedAir']").val(result.reserveVol);
                            $("[name='valveOpenTime']").val(result.openTime);
                            $("[name='valveCloseTime']").val(result.closeTime);
                        }else{
                            $("[name='alarmSquare']").val("");
                            $("[name='reservedAir']").val("");
                            $("[name='valveOpenTime']").val("");
                            $("[name='valveCloseTime']").val("");
                            layer.msg('暂无该功能参数配置信息',{
                                btnAlign: 'c',
                                time: 3000, //20s后自动关闭
                                btn: ['确定']
                            });
                        }
                    }
                });
            }else{

            }

        });
        form.on('select(controlMainboardSupplierS)', function(data){
            /*console.log(data);*/
            var controlMainboardSupplier = $("[name='controlMainboardSupplier'] option:selected").attr("name");
            console.log(controlMainboardSupplier);
            if (controlMainboardSupplier!="") {
                $.ajax({
                    //几个参数需要注意一下
                    type: "POST",//方法类型
                    dataType: "json",//预期服务器返回的数据类型
                    url: "/order/jiLian" ,//url
                    data:{pid:controlMainboardSupplier},
                    success: function (result) {
                        if (result.success>0) {
                            $("#controlMainboardNameId").empty();
                            var op="";
                            var bp="请选择控制主板名称";
                            $("#controlMainboardNameId").append("<option value="+op+" name="+op+" >"+bp+"</option>");
                            var list =result.date;
                            $.each(list,function (i,val) {
                                var a =val.id;
                                var b =val.dataname;
                                console.log( a+"**"+b)
                                $("#controlMainboardNameId").append("<option value="+b+" name="+a+" >"+b+"</option>");
                            });
                            form.render('select');
                             /*layui.form('select').render();*/
                        }else{
                            layer.msg('暂无该信息',{
                                btnAlign: 'c',
                                time: 3000, //20s后自动关闭
                                btn: ['确定']
                            });
                        }
                    }
                });
            }else{

            }

        });
        form.on('select(controlMainboardNameS)', function(data){
            /*console.log(data);*/
            var controlMainboardNameS = $("[name='controlMainboardName'] option:selected").attr("name");
            console.log(controlMainboardNameS+"name");
            if (controlMainboardNameS!="") {
                $.ajax({
                    //几个参数需要注意一下
                    type: "POST",//方法类型
                    dataType: "json",//预期服务器返回的数据类型
                    url: "/order/jiLian" ,//url
                    data:{pid:controlMainboardNameS},
                    success: function (result) {
                        if (result.success>0) {
                            $("#controlMainboardSpecificationsId").empty();
                            var op="";
                            var bp="请选择规格型号";
                            $("#controlMainboardSpecificationsId").append("<option value="+op+" name="+op+" >"+bp+"</option>");
                            var list =result.date;
                            $.each(list,function (i,val) {
                                var a =val.id;
                                var b =val.dataname;
                                console.log( a+"**"+b)
                                $("#controlMainboardSpecificationsId").append("<option value="+b+" name="+a+" >"+b+"</option>");
                            });
                            form.render('select');
                            /*layui.form('select').render();*/
                        }else{
                            layer.msg('暂无该信息',{
                                btnAlign: 'c',
                                time: 3000, //20s后自动关闭
                                btn: ['确定']
                            });
                        }
                    }
                });
            }else{

            }

        });
        form.on('select(controlMainboardSpecificationsS)', function(data){
            /*console.log(data);*/
            var controlMainboardSpecificationsS = $("[name='controlMainboardSpecifications'] option:selected").attr("name");
            console.log(controlMainboardSpecificationsS+"name");
            if (controlMainboardSpecificationsS!="") {
                $.ajax({
                    //几个参数需要注意一下
                    type: "POST",//方法类型
                    dataType: "json",//预期服务器返回的数据类型
                    url: "/order/jiLian" ,//url
                    data:{pid:controlMainboardSpecificationsS},
                    success: function (result) {
                        if (result.success>0) {
                            $("#versionId").empty();
                            var op="";
                            var bp="请选择程序版本";
                            $("#versionId").append("<option value="+op+" name="+op+" >"+bp+"</option>");
                            var list =result.date;
                            $.each(list,function (i,val) {
                                var a =val.id;
                                var b =val.dataname;
                                console.log( a+"**"+b)
                                $("#versionId").append("<option value="+b+" name="+a+" >"+b+"</option>");
                            });
                            form.render('select');
                            /*layui.form('select').render();*/
                        }else{
                            layer.msg('暂无该信息',{
                                btnAlign: 'c',
                                time: 3000, //20s后自动关闭
                                btn: ['确定']
                            });
                        }
                    }
                });
            }else{

            }

        });
        form.on('submit(demo)', function(data){
           /* console.log(data.elem) //被执行事件的元素DOM对象，一般为button对象
            console.log(data.form) //被执行提交的form对象，一般在存在form标签时才会返回
            console.log(data.field) *///当前容器的全部表单字段，名值对形式：{name: value}
           /* console.log(JSON.stringify(data.field));*/
            if (data.field.valveOpenTime<=0||data.field.valveCloseTime<=0) {
                layer.msg('开关阀时间不能小于0', {
                    btnAlign: 'c',
                    time: 3000, //20s后自动关闭
                    btn: ['确定']
                });
            }else{
                $.ajax({
                    url: "/order/addProductOrder",
                    async: true,
                    type: "post",
                    data: JSON.stringify(data.field),
                    dataType: "json",
                    contentType: 'application/json; charset=UTF-8',
                    success: function(result) {
                        if(result.success >0) {
                            layer.msg('操作成功', {
                                btnAlign: 'c',
                                time: 3000, //20s后自动关闭
                                btn: ['确定']
                            });
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        } else {
                            console.log(result.date);

                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }
                    }
                });
            }
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
       /* window.location.href="/";*/
      /*  form.render();*/
    });


   /* function pressure() {
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/queryLocal" ,//url
            data:{pid:104},
            success: function (result) {
                if (result.success>0) {
                    var list =result.date;
                    $("[name='pressure']").empty();
                    var op="";
                    var bp="请选择使用压力";
                    $("[name='pressure']").append("<option value="+op+">"+bp+"</option>");
                    $.each(list,function (i,val) {
                        $("[name='pressure']").append("<option value="+val+">"+val+"</option>");
                    });
                }else{
                    alert("信息错误");
                }
            }
        });
    }*/

</script>
</body>

</html>